package net.cjw.initsb.service.impl;

import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageInfo;

import net.cjw.initsb.common.ServiceResult;
import net.cjw.initsb.dao.RolePermissionConnectMapper;
import net.cjw.initsb.entity.RolePermissionConnect;
import net.cjw.initsb.service.RolePermissionServiceI;
import net.cjw.initsb.utils.UUIDBuild;

@Service
@Transactional
public class RolePermissionConnectServiceImpl implements RolePermissionServiceI {

	Logger logger = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private RolePermissionConnectMapper rolePermissionConnectMapper;

	@Override
	public ServiceResult<RolePermissionConnect> selectOne(RolePermissionConnect entity) {
		
		return null;
	}

	@Override
	public ServiceResult<Object> selectAll(Integer start, Integer max) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public ServiceResult<String> create(RolePermissionConnect entity) {
		RolePermissionConnect rp = rolePermissionConnectMapper.selectOne(entity);
		if (rp == null) {
			entity.setCreateTime(new Date());
			entity.setId(UUIDBuild.createUUId());
			rolePermissionConnectMapper.insert(entity);
		}

		return ServiceResult.buildSuccess();
	}

	@Override
	public ServiceResult<String> delete(RolePermissionConnect entity) {
		rolePermissionConnectMapper.delete(entity);
		return ServiceResult.buildSuccess();
	}

	@Override
	public ServiceResult<String> update(RolePermissionConnect entity) {
		// TODO Auto-generated method stub
		return null;
	}

}
